#include <ctype.h>
#include<iostream>
#include<cctype>
#include<string.h>
using namespace std;
class Solution {
public:
    bool areNumbersAscending(string s) {
        int flag=-1;
        for(int i=0;i<s.size();i++)
        {   
            int tmp=0;
            while(i!=s.size()-1&&isdigit(s[++i]))
            {
                
                tmp=tmp*10+s[i]-'0';
        
            }
            if(flag<tmp)
                flag=tmp;
            else
                return false;
        }
        return true;
    }
};
int main()
{
    Solution s1;
    cout<<s1.areNumbersAscending("1 box has 3 blue 4 red 6 green and 12 yellow marbles");
    getchar();
}